package main

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

func main() {
	r := gin.Default()
	r.LoadHTMLGlob("templates/**/*")
	r.GET("/index", func(c *gin.Context) {
		c.HTML(http.StatusOK, "index.tmpl", gin.H{
			"title": "Main website",
		})
	})
	go r.Run(":8003")
	r1 := gin.Default()
	r1.LoadHTMLGlob("templates/**/*")
	r1.GET("/posts/index", func(c *gin.Context) {
		c.HTML(http.StatusOK, "posts/index.tmpl", gin.H{
			"title": "这是我的posts目录下的index页面",
		})
	})
	r1.Run(":8301")
}
